package pers.zxk.jlytnews.dao;

import pers.zxk.jlytnews.entity.User;

import java.sql.SQLException;
import java.util.List;

/**
 * 微信文章分类（公众号）接口
 */
public interface UserDao {
    //添加用户
    public boolean addUser(User user) throws SQLException, ClassNotFoundException;

    //删除用户
    public boolean delUser(String username) throws SQLException, ClassNotFoundException;

    //更新用户
    public boolean updateUser(User user) throws SQLException, ClassNotFoundException;

    //登录
    public User login(User user) throws SQLException, ClassNotFoundException;

    //更新最后一次登录日期
    public boolean updateLastDate(User user) throws SQLException, ClassNotFoundException;

    //检查重名
    public boolean checkUserName(String username) throws SQLException, ClassNotFoundException;

    //是否管理员
    public boolean isAdmin(User user) throws SQLException, ClassNotFoundException;

    //注册
    public boolean registerUser(User user) throws SQLException, ClassNotFoundException;

    //获取用户信息
    public User getUserInfo(User user) throws SQLException, ClassNotFoundException;

    //获取全部用户信息
    public List<User> getUserList(int page, int size) throws SQLException, ClassNotFoundException;

    //修改密码
    public boolean updatePassword(String userName, String oldPassword, String newPassword) throws SQLException, ClassNotFoundException;

    //修改昵称
    public boolean updateNickname(User user) throws SQLException, ClassNotFoundException;

    //修改性别
    public boolean updateGender(User user) throws SQLException, ClassNotFoundException;

    //设置管理员
    public boolean updateAdmin(User user) throws SQLException, ClassNotFoundException;

    //修改手机号码
    public boolean updatePhone(User user) throws SQLException, ClassNotFoundException;

    //修改部门
    public boolean updateDept(User user) throws SQLException, ClassNotFoundException;

    //修改部门
    public boolean updateIcon(User user) throws SQLException, ClassNotFoundException;

}
